import { defineStore } from 'pinia'
const usePermissionStore = defineStore({
  id: 'permission',
  state: () => ({
    siteName: '返回',
    siderType: 'ALL' //ALL SITE AD_BANK
  }),
  getters: {},
  actions: {
    setSiteName(name: string) {
      this.siteName = name
    },
    setSiderType(type: string) {
      this.siderType = type
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'permission', // 默认key是上面store的id，可自定义key
        storage: localStorage, // 默认是sessionStorage会话存储，可以设置为localStorage本地长存储
        paths: ['siteName', 'siderType']
      }
    ]
  }
})
export default usePermissionStore
